﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WaveMaster.Holidays.Club.SQL
{
    public class VesselSQL
    {
        public static string GetAllVessel()
        {
            string sql = "select * from vessel";
            return sql;
        }

        public static string GetVesselByID()
        {
            string sql = "select * from vessel where m_vesselID = ?m_vesselID ";
            return sql;
        }
        public static string SearchVesselByCodeName(string p)
        {
            string sql = "select * from vessel WHERE concat(m_vesselCode,m_vesselName) like '%" + p + "%'";
            return sql;
        }
        public static string DeleteVesselByID()
        {
            return @"DELETE FROM vessel
      WHERE m_vesselID = ?m_vesselID";
        }
        public static string InsertVessel()
        {
            string sql = @"INSERT INTO vessel
           (m_vesselCode
           ,m_vesselName
            ,m_country
            ,m_remark
            ,m_flag
           ,m_cretnDate            
            ,m_cretnBy
            ,m_modfctnDate
            ,m_modfctnBy
            ,m_capacity
            )
     VALUES
           (?m_vesselCode
           ,?m_vesselName
            ,?m_country
            ,?m_remark
            ,?m_flag
           ,?m_cretnDate
            , ?m_cretnBy
            , ?m_modfctnDate
            ,?m_modfctnBy
            ,?m_capacity)";
            return sql;
        }
        public static string UpdateVessel()
        {
            string sql = @"UPDATE vessel
   SET m_vesselCode=?m_vesselCode
           ,m_vesselName=?m_vesselName
             ,m_country=?m_country
            ,m_remark=?m_remark
            ,m_flag=?m_flag
            ,m_modfctnDate=?m_modfctnDate
            ,m_modfctnBy=?m_modfctnBy
            ,m_capacity=?m_capacity
 WHERE m_vesselID = ?m_vesselID";
            return sql;
        }
    }
}
